<template>
	<view class="">
		<view class="e-flex-xy-center sticky-sw-list-title e-font-30">· 捡漏客户 ·</view>
		<view class="e-p-20">
			<view class="app-leaks__item bg-white e-radius-20 e-m-b-20 e-p-20 e-flex" v-for="(item,index) in list"
				:key="item.id" @tap="handleShow(item)">
				<e-avatar :defaultUrl="$staticPath('default-headerImg.png')" :src="$fullLink(item.userPhoto)"
					size="100rpx"></e-avatar>
				<view class="e-flex-1 e-p-l-30">
					<view class="e-m-b-10">{{item.userNickname}}</view>
					<view class="c-secondary">{{item.userPhone}}</view>
				</view>
			</view>
			<empty :text="$t('user.暂无记录')" :icon="$staticPath('default_img.png')" show v-if="list.length === 0"></empty>
			<load-more v-else :showLoad="showLoad"></load-more>
		</view>
	</view>
</template>

<script setup>
	import {
		ref,
		reactive,
		watch,
		computed
	} from 'vue';
	import {
		swCustomerList
	} from '@/common/request/api'
	import {
		useCurrentInstance,
		useQueryPage
	} from '@/common/hooks';
	import {
		onLoad,
		onShow,
		onPullDownRefresh,
		onReachBottom
	} from '@dcloudio/uni-app';
	const {
		showLoad,
		list,
		handleQueryPage,
		handleRefresh
	} = useQueryPage({
		api: swCustomerList,
		option: {
			responseKey: 'data.rows'
		},
	});


	onReachBottom(() => {
		handleQueryPage()
	})

	onLoad(() => {
		handleRefresh()
	})
</script>

<style lang="scss" scoped>
	.scroll-view-box {
		height: 100vh;
	}

	.sticky-sw-list-title {
		position: sticky;
		top: 0;
		padding: 30rpx;
		background: #f7f7f7;
		z-index:999
	}
</style>